class ProjectReportsController < ApplicationController
  unloadable

  before_filter :find_project, :except => [:show]

  helper :issues
  include IssuesHelper

  def index
    @report_forms = []
    return unless @project
    @report_forms = ProjectReportForm.find(:all, :conditions => ["#{ProjectReportForm.table_name}.project_id = ?", @project.id])
  end

  def show
    return unless params
    return unless params[:id]
    @report = ProjectReport.find(params[:id])
    return unless @report
    @project = @report.project
  end

private
  def find_project
    @project = Project.find(params[:id])
  rescue ActiveRecord::RecordNotFound
    render_404
  end

end
